#@layer()

#define script()
<script src="#(CPATH)/static/components/jquery-file-upload/js/vendor/jquery.ui.widget.js"></script>
<script src="#(CPATH)/static/components/jquery-file-upload/js/jquery.iframe-transport.js"></script>
<script src="#(CPATH)/static/components/jquery-file-upload/js/jquery.fileupload.js"></script>
<script>

    $('#cfile').fileupload({
        dropZone: $('#uploader'),
        url: '#(CPATH)/commons/attachment/upload',
        sequentialUploads: true,
        done: function (e, data) {
            if (data.result.state == "ok") {
                $('#paidProof').val(data.result.src);
                toastr.success("文件上传成功...")
            } else {
                toastr.error(data.result.message)
            }
        }
    });

</script>
#end

#define css()
<link rel="stylesheet" href="#(CPATH)/static/components/jquery-file-upload/css/jquery.fileupload.css">
<style>
    #uploader {
        height: 180px;
        border: 1px dashed #999;
        padding: 10px;
    }

    .myPanel {
        font-size: 25px;
        color: #ccc;
        text-align: center;
        padding-top: 30px;
    }
</style>
#end

#define content()

<section class="content">

    <div class="row">
        <div class="col-12">
            <form class=" form-setting autoAjaxSubmit" autocomplete="off"
                  action="#(CPATH)/admin/finance/doPayoutProcess"
                  method="POST"
                  data-ok-function="closeLayerAndRefresh()"
            >
                <input type="hidden" name="id" value="#(payout.id ??)">
                <div class="card-body">



                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label">实际转账金额</label>
                        <div class="col-sm-8">
                            <input type="input" name="amount" class="form-control"
                                   value=""
                                   placeholder="请输入实际给用户打款金额">
                        </div>
                    </div>



                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label">入账截图（证明）</label>
                        <div class="col-sm-8 ">
                            <input type="hidden" id="paidProof" name="proof" value="">
                            <div id="uploader">
                                <span class="btn btn-block btn-primary fileinput-button" style="width: 120px">
                                    <i class="fas fa-plus"></i>
                                    <span>选择图片...</span>
                                    <input id="cfile" type="file" name="files" multiple>
                                </span>

                                <div class="myPanel">
                                    或者拖动图片到这里进行上传...
                                </div>
                            </div>

                        </div>
                    </div>



                </div>
                <!-- /.card-body -->
                <div class="card-footer">
                    <div class="offset-9 col-sm-2 submit-block">
                        <div class="card-submit">
                            <button type="submit" class="btn btn-primary">确定</button>
                        </div>
                    </div>
                </div>
                <!-- /.card-footer -->
            </form>
        </div>
    </div>

</section>

#end
